<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.filesystem.folder');

class TableRole extends JTable {
    var $id                    =   null;
    var $group_id                  =   null;
    var $view        =   null;
    var $add                =   null;
    var $edit                =   null;
    var $report               =   null;

    function __construct( &$_db ) {
        parent::__construct( '#__role_pim', 'id', $_db );
    }
    
    function deleteAll($aid, $where = '') {
        JArrayHelper::toInteger($aid);
        
        foreach ($aid AS $id) {
			$this->load($id);
        }
     
        if(!is_array($aid) ) {
            $aid = array(intval($aid));
        }
            
        $query = 'DELETE FROM ' . $this->_db->nameQuote($this->_tbl) .
            	' WHERE ' . $this->_tbl_key . ' IN (' . implode(',', $aid) . ')' .
        		((!empty($where)) ? $where : '');

        $this->_db->setQuery($query);
        if ($this->_db->query()) {
            return true;
        } else {
            $this->setError($this->_db->getErrorMsg());
            return false;
        }
    }
}